<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <base href=".">
	<title>当当网</title>
	<link rel="Stylesheet" type="text/css" href="<%= basePath %>css/header_150803.css">
    <link rel="stylesheet" type="text/css" href="<%= basePath %>css/theme_1.css">
    <link rel="stylesheet" type="text/css" href="<%= basePath %>css/search_pub.css">    
</head>

<body>
	<div id="hd" style="zoom: 100%;">
	<div id="tools">
		<div class="tools"></div>
	</div>
	<div id="header_end"></div>
	
	<div style="position:relative;" class="logo_line_out">
	<div class="logo_line" dd_name="搜索框">
	
	<!-- logo -->
    <div class="logo">
		<img src="<%= basePath %>images/logoshuangshiyi.gif" usemap="#logo_link">
		<map name="logo_link" id="logo_link" dd_name="logo区">
			<area shape="rect" coords="0,18,200,93" href="#" title="当当" onfocus="this.blur();">
			<area shape="rect" coords="200,18,320,93" href="#" title="" target="_blank" onfocus="this.blur();">
		</map>
	</div>
	
	<!--页面顶端的搜索框 -->
    <div class="search">
        <form action="<%= basePath %>index" id="form_search_new" method="post">
            <label for="key_S" class="label_search" id="label_key" 
			onclick="this.style.color=&#39;rgb(255, 255, 255)&#39;;" 
			style="visibility: hidden; color: rgb(102, 102, 102);"></label>
			
            <input type="text" class="text " name="keyword" id="key_S" autocomplete="off" 
			       onclick="key_onclick(event);" onfocus="key_onfocus(event);" 
				   onblur="key_onblur();" onbeforepaste="onpaste_search();">
			
			<a href="javascript:void(0);" onclick="clearkeys();" class="del-keywords"></a>
			
			<!-- 搜索按钮 -->
			<span class="select" onmouseover="allCategoryShow();" onmouseleave="allCategoryHide();" onmouseout="if(&quot;\v&quot;!=&quot;v&quot;){ allCategoryHide();}">
				<span id="Show_Category_Name" dd_name="全部分类">我要搜索</span>
				<span class="icon"></span>
            </span>
	
            <input type="submit" id="search_btn" dd_name="搜索按钮" style="display:none">
        </form>
    </div>
	
	<!-- 购物车所在位置 -->
    <div class="ddnew_cart">
		<a href="<%= basePath %>getShoppingCart" name="cart" dd_name="购物车">
			<i class="icon_card"></i>购物车
			<b id="cart_items_count">
				${count}
			</b>
		</a>
	</div>
	
	<!-- 购物车旁边的订单按钮 -->
    <div class="ddnew_order">
		<a target="_blank" href="<%= basePath %>user/initpage" name="个人中心" dd_name="个人中心" rel="nofollow">
			个人中心
			<b id="unpaid_num" style="color:#ff2832;font:bold 12px Arial;"></b>
		</a>
	</div>

	</div>

	<div class="nav_top" dd_name="一级导航条">
		<div class="nav_top">
			<ul>
				<li class="all">
					<a href="#" id="a_category" name="cate" class="sort_button" onmouseover="showCategory(&#39;a_category&#39;,&#39;__ddnav_sort&#39;,&#39;#&#39;);" onmouseout="closeCategory(&#39;__ddnav_sort&#39;);" dd_name="全部商品分类" target="_blank">全部商品分类</a>
				</li>
			</ul>
		</div>
		<div class="spacer"></div>
		<div id="component_2120663"></div>
		<div class="spacer"></div>

		<div id="component_2723360"></div>

		<!-- 商品总数量 -->
		<div class="crumbs_fb clearfix">
			<div class="crumbs_fb_left">
				<a href="<%= basePath %>index" name="breadcrumb-all" class="a">全部</a>
				<!-- 搜索关键字 -->
				<c:if test="${not empty keyword}">
					<span class="sp">&gt;</span>
					<span class="search_word">
						<c:out value="${keyword}"></c:out>
					</span>
				</c:if>
			</div>
			<!-- 搜索结果 -->
			<span class="sp total">
				共<em class="b">${pager.pagectrl.rscount}</em>件商品
			</span>
		</div>

		<div class="spacer"></div>
	</div>
	
	<div class="spacer"></div>
	<div id="12808" class="con search_wrap clearfix" name="12815">
	<div id="12810" class="col search_left" name="12817">
	<div class="" name="m940032_pid0_t12839">
	<div id="component_940032"></div>

	<!-- 商品列表 -->
	<div class="con shoplist" name="m940032_pid0_t12840">
		<div id="search_nature_rg">
			<ul class="bigimg" id="component_0__0__6612">
				<c:forEach items="${pager.list}" var="goods">
					<!-- 商品项 -->
					<li class="line1" id="p22862060">
						<a title="${goods.gname}" class="pic" name="itemlist-picture" 
							href="#" target="_blank" style="-webkit-transform: scale(1);">
							
							<!-- 商品图片 -->
							<img src="<%= basePath %>${goods.gimg}" alt="${goods.gname}">
								 
							<div id="gwd_float_curve_trigger" class="gwd_float_curve_trigger gwd_float_curve_lowest" style="left: 60px; top: 160px;">
								<div class="gwd_float_curve_wrapper">
								</div>
							</div>
						</a>
						<!-- 商品名称 -->
						<p class="name" name="title">
							<a title="${goods.gname}" href="<%= basePath %>detail/${goods.gid}" ddclick="act=normalResult_title&amp;pos=22862060_0_1_q" 
								name="itemlist-title" target="_blank"> 
								${goods.gname}
							</a>
							<a target="_blank" href="#">还剩${goods.gcount}件</a>
							<br>
						</p>
						
						<!-- 商品价格 -->
						<p class="price"> 
							<a class="search_discount" style="text-decoration:none;">定价：</a>
							<span class="search_now_price">
								￥${goods.gprice}
							</span>
						</p>
						
						<p class="dang" style="display: block">当当自营</p>
						
						<!-- 加入购物车按钮 -->
						<p class="bottom_p">
							<a class="search_btn_cart" name="Buy" dd_name="加入购物车" 
								href="<%= basePath %>addToShoppingCart${goods.gid}" ddclick="act=normalResult_addToCart&amp;pos=22862060_0_1_q">
								加入购物车
							</a>
						</p>
					</li>
				</c:forEach>
			</ul>
		</div>
</div>

<div id="component_1559565"></div>
<div class="con paginating clearfix" name="m1559565_pid0_t12836" style="margin-top: 40px;">


<!--  分页显示控件  -->
<div class="paging">
    <ul name="Fy">
    
    	<!-- 上一页按钮，如果是第一页不显示 -->
       	<c:if test="${pager.pagectrl.currentindex!=1}">
       		<li class="prev">
				<a href="<%= basePath %>index${pager.pagectrl.currentindex - 1}">上一页</a>
			</li>
		</c:if>
		
		
		<!-- 从第一页开始循环 -->
		<c:forEach begin="${pager.pagectrl.minpage}" step="1" end="${pager.pagectrl.maxpage}" var="index">
			<li>
				<!-- 如果是当前页 -->
				<c:if test="${pager.pagectrl.currentindex==index}" var="t">
					<a class="current" name="bottom-page-turn">${index}</a>
				</c:if>
				
				<!-- <span>...</span> -->
				
				<!-- 如果不是当前页 -->
				<c:if test="${!t}">
					<a href="<%=basePath%>index${index}" class="null" name="bottom-page-turn">${index}</a>
				</c:if>
			</li>
		</c:forEach>
		
		<!-- 下一页按钮，如果是最后一页不显示 -->
       	<c:if test="${pager.pagectrl.currentindex==pager.pagectrl.pagecount}" var="fp">
			<li class="next">
        		<a href="<%=basePath%>index${pager.pagectrl.currentindex+1}">下一页</a>
        	</li>
		</c:if>
		
    </div>
</script>

</ul>
</div>

</body></html>